;;; a crosshair state for the fmri machine

(in-package :experiment)

(defclass fmri-crosshair (crosshair)
  ((count :initform 0 :accessor crosshair-count)))

(defmethod state-init (experiment (state fmri-crosshair))
  (log experiment 'start))

(define-action count-pulses ((state fmri-crosshair)
                             (keypress :char #\^))
  (incf (crosshair-count state))
  (when (>= (* (1- (crosshair-count state)) 2)
	    (crosshair-duration state))
    (state-onward *experiment* state)))
